package com.chongbangbang.pojo;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户发布的帖子
 * </p>
 *
 * @author TP
 * @since 2022-03-19 15:23:54
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("blog")
@ApiModel(value = "Blog对象", description = "用户发布的帖子")
public class Blog implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("blog表的自增id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("用户的主键Id")
    @TableField("author_id")
    private Integer authorId;

    @ApiModelProperty("作者名字")
    @TableField("author_name")
    private String authorName;

    @ApiModelProperty("作者头像")
    @TableField("author_avatar")
    private String authorAvatar;

    @ApiModelProperty("排序值，1置顶，0普通")
    @TableField("sort")
    private Integer sort;

    @ApiModelProperty("blog分类")
    @TableField("blog_type")
    private String blogType;

    @ApiModelProperty("blog的标题")
    @TableField("title")
    private String title;

    @ApiModelProperty("blog的副标题")
    @TableField("subtitle")
    private String subtitle;

    @ApiModelProperty("blog的正文")
    @TableField("content")
    private String content;

    @ApiModelProperty("浏览量")
    @TableField("views")
    private Integer views;

    @ApiModelProperty("创建时间")
    @TableField(value = "gmt_create", fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;

    @ApiModelProperty("修改时间")
    @TableField(value = "gmt_modified", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime gmtModified;

    @ApiModelProperty("逻辑删除")
    @TableField("`delete`")
    @TableLogic
    private Integer delete;


}
